package com.zmn.plat.admin.controller.appointment.appointmentsetting;

import java.util.List;

import javax.annotation.Resource;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.plat.model.entity.appointment.appointmentsetting.AppointmentSetting;
import com.zmn.plat.model.entity.appointment.appointmentsetting.AppointmentSettingQuery;
import com.zmn.plat.services.interfaces.appointment.appointmentsetting.AppointmentSettingService;

/**
 * 预约设置基础查询Controller
 *
 * @author xujie
 * @since 2020-09-04 16:29:25
 */
@RestController
@RequestMapping("/appointment/appointmentsetting/")
public class AppointmentSettingListController extends AppointmentSettingBaseController {

    @Resource
    private AppointmentSettingService appointmentSettingService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("/appointment/appointmentsetting/list.action")
    public ModelAndView list(@ModelAttribute AppointmentSettingQuery query) {

        ModelAndView mav = new ModelAndView("appointment/appointmentsetting/list");
        mav.addObject("vo", query);
        return mav;
    }

    /**
     * 列表
     */
    @RequestMapping("/listQuery")
    @ResponseBody
    public ResponseDTO<List<AppointmentSetting>> listQuery(@RequestBody AppointmentSettingQuery query) {

        List<AppointmentSetting> items = appointmentSettingService.listByQuery(query);
        return ResponseDTO.success(items, "查询成功");
    }

}
